<?php
require_once ("includes/table-admin.php");

class Table_admin_entry extends Table_admin{

function Table_admin_entry(){
	$this->Table_admin("Tên bài viết","entries");
}

function mysql_string(){
	return 'SELECT * FROM entry ORDER BY date_created DESC';
}

function a_row($num_row,$num_item,$data){
	$html_row = <<<HTML
	<tr class="%s">
        <td>%s</td>
        <td class="left">%s</td>
        <td><a href="admin.php?view=edit&id=%s">Xem</a></td>
        <td><a href="action.php?do=del_entry&id=%s">Xóa</a></td>
    </tr>
HTML;

	$class = 'row'.($num_row%2+1);	
	return sprintf($html_row,$class,$num_item,$data['title'],$data['entry_id'],$data['entry_id']);
}
}

if (!check_permission('admin')){return;}
$_table_admin_entry = new Table_admin_entry();
$_table_admin_entry->html();

?>